/*
 * Created: 2022-08-27 16:14:34
 * Author : 涛涛涛
 */

import React, { FC } from 'react';
import { View, Text } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
export interface IProps extends ICompProps {
    label: string;
    value: string;
}
LabelValue.defaultProps = {} as Partial<IProps>;
function LabelValue(props: IProps) {
    const { className, style, label, value } = props;
    const localClassName = useClassName('LabelValue', className);
    return (
        <RootView className={localClassName} style={style}>
            <View className="label">{label}</View>
            <View className="colon">:</View>
            <View className="value">{value}</View>
        </RootView>
    );
}
export default React.memo(LabelValue as FC<IProps>);
const RootView = styled(View)`
    &.LabelValue {
        & + .LabelValue {
            margin-top: 20px;
        }
        display: flex;
        .colon {
            margin: 0 4px;
        }
    }
`;
